<script type="text/javascript" language="javascript">
    //<![CDATA[
         var tree;
         var url = "<?php echo HttpUtil::baseUrl();?>";
         $(document).ready(function(){
            var xml = '<?php echo $this->xml ?>';
            var imagePath = "<?php echo HttpUtil::baseUrl();?>/images/dhtmltreeimgs/";
            $('.metadata_tree_form_tree > .center_form_btn_div').css('cursor','default');
            if(xml == ''){
                $('#add_set_btn_div').click(function(){
                    MetadataSet.showAddForm("set");
                });
                $('#add_set_img').attr('src',url+'/images/add.gif');
                $('#add_set_btn_div').css('cursor','pointer');
            }else{
	            tree = MetadataSet.initSetTree("treeboxbox_tree",xml,imagePath,0);
	            //tree.setOnCheckHandler(MetadataSet.selectCheckBox);
	            tree.setOnClickHandler(MetadataSet.clickTreeNode);
	            tree.openAllItems('set_'+$('#setId').val());
            }
         });
     //]]>
</script>
<br/>
<div class="clear"></div>
<div class="centerbig_form">
	<input type="hidden" id="baseUrl" name="baseUrl" value="<?php echo HttpUtil::baseUrl();?>" />
	<input type="hidden" id="TreeNodeEventId" name="TreeNodeEventId" value="<?php echo $this->id;?>" />
	<input type="hidden" id="setId" name="setId" value="<?php echo $this->id;?>" />
	<input type="hidden" id="alertTitle" name="alertTitle" value="<?php echo $this->translate("alertSucTitle");?>" />
	<input type="hidden" id="alertInsertMsg" name="alertInsertMsg" value="<?php echo $this->translate("alertInsertMsg");?>" />
	<input type="hidden" id="alertUpdateMsg" name="alertUpdateMsg" value="<?php echo $this->translate("alertUpdateMsg");?>" />
	<input type="hidden" id="alertDelMsg" name="alertDelMsg" value="<?php echo $this->translate("alertDelMsg");?>" />
	<input type="hidden" id="removeBtn" name="removeBtn" value="<?php echo $this->translate("remove");?>" />
	<input type="hidden" value="<?php echo $this->translate("defaultValueLabel"); ?>" id="defaultValueLabel" />
    <div class="center_top"><span class="center_top_title"><?php echo $this->translate("editMetadataSet"); ?></span>
    	 <div class="center_form_right">
	        <div class='center_form_btn_div pointer' onclick='javascript:Common.gotoUrl("<?php echo HttpUtil::baseUrl();?>/metadata/set");'>
	            <div class='center_form_btn_pic'>
	                <img src='<?php echo HttpUtil::baseUrl();?>/images/cancel.gif'/>
	            </div><div class='center_form_btn_text'><?php echo $this->translate("returnBtn"); ?></div>
	        </div>
	    </div>
    </div>
	    
    <div class="metadata_tree_form">
        <div class="metadata_tree_form_tree">
       
					<div id="add_set_btn_div" class='center_form_btn_div' style="float: none;height:20px;" >
			            <div class='center_form_btn_pic'>
			                <img id="add_set_img" src='<?php echo HttpUtil::baseUrl();?>/images/add_disable.png'/>
			            </div><div class='center_form_btn_text'><?php echo $this->translate("addSetBtn"); ?></div>
			              <div class="clear"></div>
			        </div>
			        <div class="clear"></div>
			        <div id="add_group_btn_div" class='center_form_btn_div' style="float: none;height:20px;" >
			            <div class='center_form_btn_pic'>
			                <img id="add_group_img" src='<?php echo HttpUtil::baseUrl();?>/images/add_disable.png'/>
			            </div><div class='center_form_btn_text'><?php echo $this->translate("addGroupBtn"); ?></div>
			              <div class="clear"></div>
			        </div>
			        <div class="clear"></div>
			        <div id="add_metadata_btn_div" class='center_form_btn_div' style="float: none;height:20px;" >
			            <div class='center_form_btn_pic'>
			                <img id="add_metadata_img" src='<?php echo HttpUtil::baseUrl();?>/images/add_disable.png'/>
			            </div><div class='center_form_btn_text'><?php echo $this->translate("addMetadataBtn"); ?></div>
			              <div class="clear"></div>
			        </div>
			        <div class="clear"></div>
			<div class="clear"></div>
			
        	<div style="margin:5px 0; color:#acc3d5;margin-top:10px;" id="treeboxbox_tree">

        	</div>
        </div>
        <div class="metadata_tree_form_split">&nbsp;</div>
        <div class="metadata_tree_form_content" id='metadata_tree_form_content'>

		</div>
		<div class="clear"></div>
    </div>
	

	<div class='clear'></div>
</div>
<div class='clear'></div>
